import { getSendSmsCountList } from '../../../../api/sms'
import { ref } from "vue";
import { GetSendCountListParam, SendCountListItem } from "../types";

// 获取数量列表加载
const getSendSmsCountListLoading = ref(false)

// 数量列表
const sendSmsCountList = ref<Array<SendCountListItem>>([])

// 列表总数量
const totalList = ref(0)

// 获取数量列表方法
const getSendSmsCountListFn = async (param: GetSendCountListParam) => {
    getSendSmsCountListLoading.value = true
    const res = await getSendSmsCountList(param)
    getSendSmsCountListLoading.value = false
    sendSmsCountList.value = res.data.data.rows
    totalList.value = res.data.data.total
}

export default {
    totalList,
    sendSmsCountList,
    getSendSmsCountListLoading,
    getSendSmsCountListFn
}
